9 void print(vector
<int> &a
, vector
<int> &p
, const int &i
){
18 cin
>> casos
; while (getchar() != '\n');
23 if (!first
) cout
<< endl
;
26 while (getline(cin
, s
) && s
!= ""){
33 vector
<int> p(a
.size());
34 vector
<int> dp(a
.size());
35 for (int i
=0; i
<a
.size(); ++i
){
38 // cout << "i es: " << i << endl;
39 for (int j
=0; j
<i
; ++j
){
40 //cout << " j es: " << j << endl;
41 if (a
[i
] > a
[j
] && dp
[j
] + 1 > dp
[i
]){
48 // cout << "a es: "; copy(a.begin(), a.end(), ostream_iterator<int>(cout, " "));
51 // cout << "dp es: "; copy(dp.begin(), dp.end(), ostream_iterator<int>(cout, " "));
56 for (int i
=0; i
<a
.size(); ++i
){
62 cout
<< "Max hits: " << best
<< endl
;
63 print(a
, p
, indexMax
);